﻿using Basic.FlowRemoteModel.NodeFormPower;
using Basic.FlowRemoteModel.NodeFormPower.Model;
using Basic.FlowService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class NodeFormPowerEvent : IRpcApiService
    {
        private readonly INodeFormPowerService _Service;

        public NodeFormPowerEvent ( INodeFormPowerService service )
        {
            this._Service = service;
        }

        public FormColPower[] GetsNodeFormPower ( GetsNodeFormPower obj )
        {
            return this._Service.Gets(obj.NodeId);
        }

        public void SetNodeFormPower ( SetNodeFormPower obj )
        {
            this._Service.Sync(obj.FlowId, obj.NodeId, obj.Powers);
        }
    }
}
